﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OALPTool
{
    public partial class Form8 : Form
    {
        public Form8()
        {
            InitializeComponent();
        }

        private void Form8_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("1", typeof(System.String));
            dt.Columns.Add("2", typeof(System.String));
            dt.Columns.Add("3", typeof(System.String));
            dt.Columns.Add("4", typeof(System.String));
            dt.Columns.Add("5", typeof(System.String));
            dt.Columns.Add("6", typeof(System.String));
            dt.Columns.Add("7", typeof(System.String));
            dt.Columns.Add("8", typeof(System.String));
            dt.Columns.Add("9", typeof(System.String));
            dt.Columns.Add("10", typeof(System.String));
            dt.Columns.Add("11", typeof(System.String));
            dt.Columns.Add("12", typeof(System.Decimal));
            dt.Rows.Add("中国", "上海", "5000", "7000", "7000", "7000", "7000", "7000", "7000", "7000", "7000", "0.0154035736290819");
            boundGridView1.DataSource = dt;
            boundGridView1.AutoGenerateColumns = false;

            HeaderItem item = this.boundGridView1.Headers.GetHeaderByLocation(0, 0);  //获取包括坐标(0,0)的单元格
            item.EndY = 2;
            item = this.boundGridView1.Headers.GetHeaderByLocation(9, 0);
            item.EndY = 2;
            item = this.boundGridView1.Headers.GetHeaderByLocation(10, 0);
            item.EndY = 2;
            item = this.boundGridView1.Headers.GetHeaderByLocation(11, 0);
            item.EndY = 2;

            this.boundGridView1.Headers.AddHeader(1, 2, 1, 1, "语文"); //增加表头，起始坐标(1,1) ,终止坐标(2,1) 内容"语文"
            this.boundGridView1.Headers.AddHeader(3, 4, 1, 1, "数学");  //增加表头，起始坐标(3,1) ,终止坐标(4,1) 内容"数学"
            this.boundGridView1.Headers.AddHeader(5, 6, 1, 1, "英语");  //增加表头，起始坐标(5,1) ,终止坐标(6,1) 内容"英语"
            this.boundGridView1.Headers.AddHeader(7, 8, 1, 1, "X科");  //增加表头，起始坐标(7,1) ,终止坐标(8,1) 内容"X科"
            this.boundGridView1.Headers.AddHeader(1, 8, 2, 2, "成绩");  //增加表头，起始坐标(1,2) ,终止坐标(8,2) 内容"成绩"

           

        }
    }
}
